//
//  XLUploadFileTool.h
//  industry
//
//  Created by xl on 2020/12/1.
//  Copyright © 2020 Haier. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void (^UploadDatasSuccessBlock)(NSDictionary *dict);
typedef void (^UploadDatasFailBlock)(NSError *error, XLNetworkReachabilityStatus reachabilityStatus);
typedef void (^DeleteDatasSuccessBlock)(NSDictionary *dict);
typedef void (^DeleteDatasFailBlock)(NSError *error);

@interface XLUploadFileTool : NSObject

+ (instancetype)sharedInstance;

/** 检测oss的key是否在有消息内 **/
- (BOOL)checkExpirationTime;

/** 初始化oss client **/
- (void)initClientWithServerDic:(NSDictionary *)dic;

/** 图片上传 */
- (void)uploadImagesData:(NSArray *)imagesData
            successBlock:(UploadDatasSuccessBlock)successBlock
               failBlock:(UploadDatasFailBlock)failBlock;

/** 上传视频 */
- (void)uploadVideoDataPathUrl:(NSURL *)pathUrl
                  successBlock:(UploadDatasSuccessBlock)successBlock
                     failBlock:(UploadDatasFailBlock)failBlock;

/** 删除文件 */
- (void)deleteOssExitFiles:(NSArray *)fileNamePaths
              successBlock:(DeleteDatasSuccessBlock)successBlock
                 failBlock:(DeleteDatasFailBlock)failBlock;

/** 头像上传 */
- (void)uploadAvaterData:(NSData *)imagesData
            successBlock:(UploadDatasSuccessBlock)successBlock
               failBlock:(UploadDatasFailBlock)failBlock;

/** 缩略图上传 */
- (void)uploadThumbnailData:(NSData *)imagesData
            successBlock:(UploadDatasSuccessBlock)successBlock
               failBlock:(UploadDatasFailBlock)failBlock;

/// 资源签名
/// @param filePath 路径地址
-(NSString * )presignConstrainwithObjectKey:(NSString *)filePath;
@end


